package com.vipshop.system.web.controller;

import com.vipshop.entity.User;
import com.vipshop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

/**
 * Created by Administrator on 2017/11/24.
 */
@Controller
@RequestMapping("/system")
public class SystemHomeController {
    @Autowired
    private UserService userService;
    @RequestMapping("/index")
    public String index(Map<String, Object> map){
        User user = userService.getUserById(1);
        map.put("user", user==null?"test":user.getUserName());
        return "system/index";
    }
}
